home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / mus / misc / Lame68k.lha / lame-3.89 / Makefile < prev    next >
Encoding:
Makefile  |  2001-07-12  |  17.8 KB  |  602 lines

  1. # Makefile for LAME 3.xx
  2. #
  3. # LAME is reported to work under:  
  4. # Linux (i86), NetBSD 1.3.2 (StrongARM), FreeBSD (i86)
  5. # Compaq Alpha(OSF, Linux, Tru64 Unix), Sun Solaris, SGI IRIX,
  6. # OS2 Warp, Macintosh PPC, BeOS, Amiga and even VC++ 
  7.  
  8. # these variables are available on command line:
  9. #
  10. #   make UNAME=xxxxx ARCH=xxxxx   - specify a type of host
  11. #   make PGM=lame_exp             - specify a name of an executable file
  12. #
  13. # if you have mingw32-gcc, try:
  14. #   make UNAME=MSDOS
  15. #
  16.  
  17. ifeq ($(UNAME),MSDOS)
  18.   UNAME ?= UNKNOWN
  19.   ARCH ?= UNKNOWN_ARCH
  20. else
  21.   UNAME = $(shell uname)
  22.   ARCH = $(shell uname -m)
  23.   iARCH = $(patsubst i%86,x86,$(ARCH))
  24. endif
  25.  
  26. HAVE_NASM = NO
  27. HAVE_NEWER_GLIBC = NO
  28.  
  29. # generic defaults. OS specific options go in versious sections below
  30. PGM = lame
  31. CC = gcc
  32. CC_OPTS =  -O
  33. CPP_OPTS = -Iinclude -Impglib -Ifrontend -Ilibmp3lame
  34. AR = ar
  35. RANLIB = ranlib
  36. GTK = 
  37. GTKLIBS = 
  38. LIBSNDFILE =  
  39. LIBS = -lm 
  40. MP3LIB = libmp3lame/libmp3lame.a
  41. MP3LIB_SHARED = libmp3lame/libmp3lame.so
  42. MAKEDEP = -M
  43. BRHIST_SWITCH = 
  44. LIBTERMCAP = 
  45. RM = rm -f
  46.  
  47. CPP_OPTS += -DHAVE_CONFIG_H -I.
  48.  
  49. ##########################################################################
  50. # -DHAVEMPGLIB compiles the mpglib *decoding* library into libmp3lame
  51. ##########################################################################
  52. CPP_OPTS += -DHAVE_MPGLIB 
  53.  
  54. ##########################################################################
  55. # -DUSE_LAYER_1/2 enables Layer1 or Layer2 *decoding* abilities 
  56. ##########################################################################
  57. CPP_OPTS += -DUSE_LAYER_1 -DUSE_LAYER_2
  58.  
  59. ##########################################################################
  60. # -DTAKEHIRO_IEEE754_HACK enables Takehiro's IEEE hack 
  61. ##########################################################################
  62. ifeq ($(iARCH),x86)
  63.     CPP_OPTS += -DTAKEHIRO_IEEE754_HACK
  64. endif
  65.  
  66. ##########################################################################
  67. # Define these in the OS specific sections below to compile in support
  68. # for the Ogg Vorbis audio format (both decoding and encoding)
  69. # VORBIS = -DHAVE_VORBIS  -I ../vorbis/include
  70. # VORBIS_LIB = -L ../vorbis/lib -lvorbis
  71. ##########################################################################
  72.  
  73. ##########################################################################
  74. # Define these in the OS specific sections below to compile in code 
  75. # for the optional VBR bitrate histogram.  
  76. # Requires ncurses, but libtermcap also works.  
  77. # If you have any trouble, just dont define these
  78. #
  79. # BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_{NCURSES_}TERMCAP_H
  80. # LIBTERMCAP = -lncurses
  81. # LIBTERMCAP = -ltermcap
  82. #
  83. # or, to try and simulate TERMCAP (ANSI), use:
  84. # BRHIST_SWITCH = -DBRHIST
  85. #
  86. ##########################################################################
  87.  
  88.  
  89. ##########################################################################
  90. # Define these in the OS specific sections below to compile in code for:
  91. #
  92. # SNDLIB = -DLIBSNDFILE   to use Erik de Castro Lopo's libsndfile 
  93. # http://www.zip.com.au/~erikd/libsndfile/ instead of LAME's internal
  94. # routines.  Also set:
  95. #
  96. # LIBSNDFILE = -lsndfile
  97. # or
  98. # LIBSNDFILE = -L/location_of_libsndfile  -lsndfile
  99. #
  100. ##########################################################################
  101.  
  102.  
  103. ##########################################################################
  104. # Define these in the OS specific sections below to compile in code for
  105. # the GTK mp3 frame analyzer
  106. #
  107. # Requires  -DHAVE_MPGLIB
  108. #
  109. # GTK = -DHAVE_GTK `gtk-config --cflags`
  110. # GTKLIBS = `gtk-config --libs` 
  111. #
  112. ##########################################################################
  113.  
  114.  
  115.  
  116.  
  117. ##########################################################################
  118. # LINUX   
  119. ##########################################################################
  120. ifeq ($(UNAME),Linux)
  121. #  remove these lines if you dont have GTK, or dont want the GTK frame analyzer
  122.    GTK = -DHAVE_GTK `gtk-config --cflags`
  123.    GTKLIBS = `gtk-config --libs` 
  124. # Comment out next 2 lines if you want to remove VBR histogram capability
  125.    BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  126.    LIBTERMCAP = -lncurses
  127. #  uncomment to use LIBSNDFILE
  128. #   SNDLIB = -DLIBSNDFILE
  129. #   LIBSNDFILE=-lsndfile 
  130.  
  131. # uncomment to compile in Vorbis support
  132. #   VORBIS = -DHAVE_VORBIS -I/home/mt/mp3/vorbis/include
  133. #   VORBIS_LIB = -L/home/mt/mp3/vorbis/lib -lvorbis
  134.  
  135.  
  136. # suggested for gcc-2.7.x
  137. #   CC_OPTS =  -O3 -fomit-frame-pointer -funroll-loops -ffast-math  -finline-functions -Wall -pedantic
  138. #  CC_OPTS =  -O9 -fomit-frame-pointer -fno-strength-reduce -mpentiumpro -ffast-math -finline-functions -funroll-loops -Wall -malign-double -g -march=pentiumpro -mfancy-math-387 -pipe -pedantic
  139.  
  140. #  for debugging:
  141.   CC_OPTS =  -UNDEBUG -O -Wall -pedantic -ggdb -DABORTFP
  142.  
  143. #  for lots of debugging:
  144. #   CC_OPTS =  -DDEBUG -UNDEBUG  -O -Wall -pedantic -g -DABORTFP 
  145.  
  146.  
  147. ifeq ($(CFG),RH)
  148. #  some alternate code (work in progress Robert.Hegemann@gmx.de)
  149. #  CPP_OPTS += /DRH_???
  150. # these options for gcc-2.95.2 to produce fast code
  151.    CC_OPTS = \
  152.     -Wall -O9 -fomit-frame-pointer -march=pentium \
  153.     -finline-functions -fexpensive-optimizations \
  154.     -funroll-loops -funroll-all-loops -pipe -fschedule-insns2 \
  155.     -fstrength-reduce \
  156.     -malign-double -mfancy-math-387 -ffast-math 
  157.         
  158.    HAVE_NEWER_GLIBC = YES
  159.    HAVE_NASM = YES
  160. endif
  161.  
  162. ifeq ($(CFG),PFK)
  163.    CPP_OPTS += -DKLEMM -DKLEMM_00 -DKLEMM_01 -DKLEMM_02 -DKLEMM_03 -DKLEMM_04 -DKLEMM_05 -DKLEMM_06 -DKLEMM_07 -DKLEMM_08 -DKLEMM_09 -DKLEMM_10 -DKLEMM_11 -DKLEMM_12 -DKLEMM_13 -DKLEMM_14 -DKLEMM_15 -DKLEMM_16 -DKLEMM_17 -DKLEMM_18 -DKLEMM_19 -DKLEMM_20 -DKLEMM_21 -DKLEMM_22 -DKLEMM_23 -DKLEMM_24 -DKLEMM_25 -DKLEMM_26 -DKLEMM_27 -DKLEMM_28 -DKLEMM_29 -DKLEMM_30 -DKLEMM_31 -DKLEMM_32 -DKLEMM_33 -DKLEMM_34 -DKLEMM_35 -DKLEMM_36 -DKLEMM_37 -DKLEMM_38 -DKLEMM_39 -DKLEMM_40 -DKLEMM_41 -DKLEMM_42 -DKLEMM_43 -DKLEMM_44 -DKLEMM_45 -DKLEMM_46 -DKLEMM_47 -DKLEMM_48 -DKLEMM_49 -DKLEMM_50
  164.    CC_OPTS = \
  165.     -Wall -O9 -fomit-frame-pointer -march=pentium \
  166.     -finline-functions -fexpensive-optimizations \
  167.     -funroll-loops -funroll-all-loops -pipe -fschedule-insns2 \
  168.     -fstrength-reduce \
  169.     -malign-double -mfancy-math-387 -ffast-math 
  170.         
  171.    HAVE_NEWER_GLIBC = YES
  172.    HAVE_NASM = YES
  173. endif
  174.  
  175. ##########################################################################
  176. # LINUX on Digital/Compaq Alpha CPUs
  177. ##########################################################################
  178. ifeq ($(ARCH),alpha)
  179.  
  180. ################################################################
  181. #### Check if 'ccc' is in our path
  182. ####   if not, use 'gcc'
  183. ################################################################
  184. ifeq ($(shell which ccc 2>/dev/null | grep -c ccc),0)
  185.  
  186. # double is faster than float on Alpha
  187. CC_OPTS =       -O4 -pedantic -Wall -fomit-frame-pointer -ffast-math -funroll-loops \
  188.                 -mfp-regs -fschedule-insns -fschedule-insns2 \
  189.                 -finline-functions \
  190. #                -DFLOAT=double
  191. # add "-mcpu=21164a -Wa,-m21164a" to optimize for 21164a (ev56) CPU
  192.  
  193. ################################################################
  194. #### else, use 'ccc'
  195. ################################################################
  196. else
  197.  
  198. # Compaq's C Compiler
  199. CC = ccc
  200.  
  201. ################################################################
  202. #### set 'CC_OPTS = -arch host -tune host' to generate/tune instructions for this machine
  203. ####     'CC_OPTS += -migrate -fast -inline speed -unroll 0' tweak to run as fast as possible :)
  204. ####     'CC_OPTS += -w0 -pedantic -Wall' set warning and linking flags
  205. ################################################################
  206. CC_OPTS = -arch host -tune host
  207. CC_OPTS += -migrate -fast -inline speed -unroll 0
  208. CC_OPTS += -w0 -pedantic -Wall
  209.  
  210.  
  211. ################################################################
  212. #### to debug, uncomment
  213. ################################################################
  214. # For Debugging
  215. #CC_OPTS += -g3
  216.  
  217. ################################################################
  218. #### define __DECALPHA__ (i was getting re-declaration warnings
  219. ####   in machine.h
  220. ################################################################
  221. # Define DEC Alpha
  222. CPP_OPTS += -D__DECALPHA__
  223.  
  224. # standard Linux libm
  225. #LIBS    =    -lm
  226. # optimized libffm (free fast math library)
  227. #LIBS    =    -lffm
  228. # Compaq's fast math library
  229. LIBS    =       -lcpml
  230. endif  #  gcc or ccc?
  231. endif  #  alpha 
  232. endif  #  linux
  233.  
  234.  
  235.  
  236. ##########################################################################
  237. # FreeBSD
  238. ##########################################################################
  239. ifeq ($(UNAME),FreeBSD)
  240. #  remove if you do not have GTK or do not want the GTK frame analyzer
  241.    GTK = -DHAVE_GTK `gtk12-config --cflags`
  242.    GTKLIBS = `gtk12-config --libs` 
  243. # Comment out next 2 lines if you want to remove VBR histogram capability
  244.    BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  245.    LIBTERMCAP = -lncurses
  246.  
  247. endif
  248.  
  249.  
  250. ##########################################################################
  251. # OpenBSD
  252. ##########################################################################
  253. ifeq ($(UNAME),OpenBSD)
  254. #  remove if you do not have GTK or do not want the GTK frame analyzer
  255.    GTK = -DHAVE_GTK `gtk-config --cflags`
  256.    GTKLIBS = `gtk-config --libs` 
  257. # Comment out next 2 lines if you want to remove VBR histogram capability
  258.    BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  259.    LIBTERMCAP = -lcurses 
  260. endif
  261.  
  262.  
  263.  
  264.  
  265. ##########################################################################
  266. # SunOS
  267. ##########################################################################
  268. ifeq ($(UNAME),SunOS) 
  269.    CC = cc
  270.    CC_OPTS = -O -xCC      
  271.    MAKEDEP = -xM
  272. # for gcc, use instead:
  273. #   CC = gcc 
  274. #   CC_OPTS = -O 
  275. #   MAKEDEP = -M 
  276. endif
  277.  
  278.  
  279. ##########################################################################
  280. # SGI
  281. ##########################################################################
  282. ifeq ($(UNAME),IRIX64) 
  283.    CC = cc
  284.    CC_OPTS = -O3 -woff all 
  285.  
  286. #optonal:
  287. #   GTK = -DHAVE_GTK `gtk-config --cflags`
  288. #   GTKLIBS = `gtk-config --libs`
  289. #   BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  290. #   LIBTERMCAP = -lncurses
  291.  
  292. endif
  293. ifeq ($(UNAME),IRIX) 
  294.    CC = cc
  295.    CC_OPTS = -O3 -woff all 
  296. endif
  297.  
  298.  
  299.  
  300. ##########################################################################
  301. # Compaq Alpha running Dec Unix (OSF)
  302. ##########################################################################
  303. ifeq ($(UNAME),OSF1)
  304.    CC = cc
  305.    CC_OPTS = -fast -O3 -std -g3 -non_shared
  306. endif
  307.  
  308. ##########################################################################
  309. # BeOS
  310. ##########################################################################
  311. ifeq ($(UNAME),BeOS)
  312.    CC = $(BE_C_COMPILER)
  313.    LIBS =
  314. ifeq ($(ARCH),BePC)
  315.    CC_OPTS = -O9 -fomit-frame-pointer -march=pentium \
  316.    -mcpu=pentium -ffast-math -funroll-loops \
  317.    -fprofile-arcs -fbranch-probabilities
  318. else
  319.    CC_OPTS = -opt all
  320.    MAKEDEP = -make
  321. endif
  322. endif
  323.  
  324. ###########################################################################
  325. # MOSXS (Rhapsody PPC)
  326. ###########################################################################
  327. ifeq ($(UNAME),Rhapsody)
  328.    CC = cc
  329.    LIBS =
  330.    CC_OPTS = -O9 -ffast-math -funroll-loops -fomit-frame-pointer
  331.    MAKEDEP = -make 
  332.    
  333. endif
  334. ##########################################################################
  335. # OS/2
  336. ##########################################################################
  337. # Properly installed EMX runtime & development package is a prerequisite.
  338. # tools I used: make 3.76.1, uname 1.12, sed 2.05, PD-ksh 5.2.13
  339. #
  340. ##########################################################################
  341. ifeq ($(UNAME),OS/2)
  342.    SHELL=sh    
  343.    CC = gcc
  344.    CC_OPTS = -O3
  345.    PGM = lame.exe
  346.    LIBS =
  347.  
  348. # I use the following for slightly better performance on my Pentium-II
  349. # using pgcc-2.91.66:
  350. #   CC_OPTS = -O6 -ffast-math -funroll-loops -mpentiumpro -march=pentiumpro
  351.  
  352. # Comment out next 2 lines if you want to remove VBR histogram capability
  353.    BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  354.    LIBTERMCAP = -ltermcap
  355.  
  356. # Uncomment & inspect the 2 GTK lines to use MP3x GTK frame analyzer.
  357. # Properly installed XFree86/devlibs & GTK+ is a prerequisite.
  358. # The following works for me using Xfree86/OS2 3.3.5 and GTK+ 1.2.3:
  359. #   GTK = -DHAVE_GTK -IC:/XFree86/include/gtk12 -Zmt -D__ST_MT_ERRNO__ -IC:/XFree86/include/glib12 -IC:/XFree86/include
  360. #   GTKLIBS = -LC:/XFree86/lib -Zmtd -Zsysv-signals -Zbin-files -lgtk12 -lgdk12 -lgmodule -lglib12 -lXext -lX11 -lshm -lbsd -lsocket -lm
  361. endif
  362.  
  363. ###########################################################################
  364. # MSDOS/Windows
  365. ###########################################################################
  366. ifeq ($(UNAME),MSDOS)
  367.   RM =
  368.   PGM = lame.exe
  369. endif
  370.  
  371. ###########################################################################
  372. # AmigaOS
  373. ###########################################################################
  374. # Type 'Make ARCH=PPC' for PowerUP and 'Make ARCH=WOS' for WarpOS
  375. #
  376. ###########################################################################
  377. ifeq ($(UNAME),AmigaOS)
  378.     CC = gcc
  379.     CC_OPTS = -O3 -fomit-frame-pointer -s -ffast-math -m68040 -m68881
  380.     BRHIST_SWITCH = -DBRHIST
  381.     MAKEDEP = -MM
  382.     ifeq ($(ARCH),WOS)
  383.         CC = ppc-amigaos-gcc -warpup
  384.         CC_OPTS = -O3 -ffast-math -fomit-frame-pointer -funroll-loops \
  385.         -mmultiple -mcpu=603e
  386.         AR = ppc-amigaos-ar
  387.         RANLIB = ppc-amigaos-ranlib
  388.         LIBS =
  389.     endif
  390.     ifeq ($(ARCH),PPC)
  391.         CC = ppc-amigaos-gcc
  392.         CC_OPTS = -O3 -ffast-math -fomit-frame-pointer -funroll-loops \
  393.         -mmultiple -mcpu=603e
  394.         AR = ppc-amigaos-ar
  395.         RANLIB = ppc-amigaos-ranlib
  396.         LIBS =
  397.     endif
  398. endif
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415. # 10/99 added -D__NO_MATH_INLINES to fix a bug in *all* versions of
  416. # gcc 2.8+ as of 10/99.  
  417.  
  418. ifeq ($(HAVE_NEWER_GLIBC),YES)
  419. CC_SWITCHES = 
  420. else
  421. CC_SWITCHES = -D__NO_MATH_INLINES  # only needed by some older glibc
  422. endif
  423.  
  424. CC_SWITCHES += -DNDEBUG $(CC_OPTS) $(SNDLIB) $(GTK) \
  425. $(BRHIST_SWITCH) $(VORBIS) 
  426. frontend_sources = \
  427.     frontend/amiga_mpega.c \
  428.         frontend/brhist.c \
  429.     frontend/get_audio.c \
  430.         frontend/lametime.c \
  431.         frontend/parse.c \
  432.     frontend/portableio.c \
  433.     frontend/timestatus.c 
  434.  
  435. lib_sources = \
  436.     libmp3lame/bitstream.c \
  437.     libmp3lame/encoder.c \
  438.     libmp3lame/fft.c \
  439.         libmp3lame/id3tag.c \
  440.         libmp3lame/lame.c \
  441.         libmp3lame/newmdct.c \
  442.     libmp3lame/psymodel.c \
  443.     libmp3lame/quantize.c \
  444.     libmp3lame/quantize_pvt.c \
  445.         libmp3lame/set_get.c \
  446.     libmp3lame/vbrquantize.c \
  447.     libmp3lame/reservoir.c \
  448.     libmp3lame/tables.c \
  449.     libmp3lame/takehiro.c \
  450.     libmp3lame/util.c \
  451.     libmp3lame/vorbis_interface.c \
  452.     libmp3lame/mpglib_interface.c \
  453.         libmp3lame/VbrTag.c \
  454.         libmp3lame/version.c \
  455.         mpglib/common.c \
  456.         mpglib/dct64_i386.c \
  457.         mpglib/decode_i386.c \
  458.         mpglib/layer1.c \
  459.         mpglib/layer2.c \
  460.         mpglib/layer3.c \
  461.         mpglib/tabinit.c \
  462.         mpglib/interface.c 
  463.  
  464.  
  465. ifeq ($(UNAME),MSDOS)
  466.   frontend_sources = $(subst /,\\,$(frontend_sources))
  467.   lib_sources = $(subst /,\\,$(lib_sources))
  468. endif
  469.  
  470. frontend_obj = $(frontend_sources:.c=.o)
  471. lib_obj = $(lib_sources:.c=.o)
  472.  
  473. DEP = $(frontend_sources:.c=.d) $(lib_sources:.c=.d )
  474.  
  475. gtk_sources = frontend/gtkanal.c frontend/gpkplotting.c
  476. gtk_obj = $(gtk_sources:.c=.o)
  477. gtk_dep = $(gtk_sources:.c=.d)
  478.  
  479.  
  480.  
  481. NASM = nasm
  482. ASFLAGS=-f elf -i libmp3lame/i386/
  483. %.o: %.nas
  484.     $(NASM) $(ASFLAGS) $< -o $@
  485. %.o: %.s
  486.     gcc -c $< -o $@
  487.  
  488.  
  489. #HAVE_NASM = YES
  490.  
  491. ifeq ($(HAVE_NASM),YES)
  492. ## have NASM
  493. CC_SWITCHES += -DHAVE_NASM
  494. lib_obj += libmp3lame/i386/cpu_feat.o libmp3lame/i386/scalar.o
  495.  
  496. ## use MMX extension. you need nasm and MMX supported CPU.
  497. CC_SWITCHES += -DMMX_choose_table
  498. lib_obj += libmp3lame/i386/choose_table.o
  499.  
  500. ## use 3DNow! extension. you need nasm and 3DNow! supported CPU.
  501. CC_SWITCHES += -DUSE_FFT3DN
  502. lib_obj += libmp3lame/i386/fft3dn.o
  503.  
  504. ## not yet coded
  505. #CC_SWITCHES += -DUSE_FFTSSE
  506. #lib_obj += libmp3lame/i386/fftsse.o
  507.  
  508. ## not yet coded
  509. #CC_SWITCHES += -DUSE_FFTFPU
  510. #lib_obj += libmp3lame/i386/fftfpu.o
  511. endif
  512.  
  513.  
  514. %.o: %.c 
  515.     $(CC) $(CPP_OPTS) $(CC_SWITCHES) -c $< -o $@
  516.  
  517. %.d: %.c
  518.   ifeq ($(NOUNIXCMD),YES)
  519.     $(CC) $(MAKEDEP)  $(CPP_OPTS) $(CC_SWITCHES)  $< > $@
  520.   else
  521.     $(SHELL) -ec '$(CC) $(MAKEDEP)  $(CPP_OPTS) $(CC_SWITCHES)  $< | sed '\''s;$*.o;& $@;g'\'' > $@'
  522.   endif
  523.  
  524. all: $(PGM)
  525.  
  526. $(lib_sources) $(frontend_sources) $(gtk_sources) : config.h
  527.  
  528. config.h: configMS.h
  529.     cp configMS.h config.h
  530.  
  531. $(PGM):    frontend/main.o $(frontend_obj)  $(MP3LIB)
  532.     $(CC) $(CC_OPTS) -lm -s -o frontend/$(PGM)  frontend/main.o $(frontend_obj) \
  533.         $(MP3LIB) $(LIBS) $(LIBSNDFILE) $(LIBTERMCAP) \
  534.         $(VORBIS_LIB)
  535.  
  536. mp3x:   frontend/mp3x.o $(frontend_obj) $(gtk_obj) $(MP3LIB)
  537.     $(CC) $(CC_OPTS) -o frontend/mp3x frontend/mp3x.o $(frontend_obj) $(gtk_obj) $(MP3LIB) \
  538.         $(LIBS) $(LIBSNDFILE) $(GTKLIBS) $(LIBTERMCAP) $(VORBIS_LIB)
  539.  
  540. mp3rtp:    frontend/rtp.o frontend/mp3rtp.o  $(frontend_obj) $(MP3LIB)
  541.     $(CC) $(CC_OPTS) -o frontend/mp3rtp frontend/mp3rtp.o frontend/rtp.o $(frontend_obj) $(MP3LIB) \
  542.         $(LIBS) $(LIBSNDFILE) $(LIBTERMCAP) $(VORBIS_LIB)
  543.  
  544. libmp3lame/libmp3lame.a:  $(lib_obj)
  545.     $(AR) cr libmp3lame/libmp3lame.a  $(lib_obj)
  546.     $(RANLIB) libmp3lame/libmp3lame.a
  547.  
  548. #shared library.  GNU specific?
  549. libmp3lame/libmp3lame.so:  $(lib_obj)
  550.     gcc -shared -Wl,-soname,libmp3lame/libmp3lame.so -o libmp3lame/libmp3lame.so $(lib_obj)
  551.  
  552. install:  $(PGM) #libmp3lame.a
  553.     cp $(PGM) /usr/bin
  554.     #cp libmp3lame.a /usr/lib
  555.     #cp lame.h /usr/lib
  556.  
  557.  
  558.  
  559. clean:
  560.   ifeq ($(UNAME),MSDOS)
  561.     -del $(frontend_obj)
  562.     -del $(lib_obj)
  563.     -del $(gtk_obj)
  564.     -del $(DEP)
  565.     -del $(PGM)
  566.   else
  567.     -$(RM) $(gtk_obj) $(frontend_obj) $(lib_obj) $(DEP) $(PGM) \
  568.           frontend/main.o frontend/lame libmp3lame/libmp3lame.a \
  569.           frontend/mp3x.o frontend/mp3x
  570.   endif
  571.  
  572.  
  573. tags: TAGS
  574.  
  575. TAGS: ${c_sources}
  576.     etags -T ${c_sources}
  577.  
  578. ifneq ($(MAKECMDGOALS),clean)
  579.   -include $(DEP)
  580. endif
  581.  
  582.  
  583. #
  584. #  testcase.mp3 is a 2926 byte file.  The first number output by
  585. #  wc is the number of bytes which differ between new output
  586. #  and 'official' results.  
  587. #
  588. #  Because of compilier options and effects of roundoff, the 
  589. #  number of bytes which are different may not be zero, but
  590. #  should be at most 30.
  591. #
  592. test: $(PGM)
  593.     frontend/lame  --nores -h testcase.wav testcase.new.mp3
  594.     cmp -l testcase.new.mp3 testcase.mp3 | wc -l
  595.  
  596. testg: $(PGM)
  597.     frontend/lame -g -h ../test/castanets.wav
  598.  
  599.         
  600.